package com.weetop.cfw.home_page.adapter

import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.StringUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.coorchice.library.SuperTextView
import com.weetop.cfw.R
import com.weetop.cfw.bean.AdvertisementBean
import com.weetop.cfw.constants.UrlConstants

class HomePageRecommendAppAdapter(layoutId: Int, dataList: List<AdvertisementBean.DataBean>) :
    BaseQuickAdapter<AdvertisementBean.DataBean, BaseViewHolder>(layoutId, dataList) {

    override fun convert(helper: BaseViewHolder, item: AdvertisementBean.DataBean?) {
        val textAppLogo = helper.getView<SuperTextView>(R.id.textAppLogo)
        textAppLogo.setUrlImage("${UrlConstants.baseUrl}${item?.imgurl}")
        helper.setText(R.id.textAppAd, item?.title).setText(R.id.textAppDesc, item?.desc)

        helper.setGone(R.id.textAppDesc, !StringUtils.isEmpty(item?.desc))
    }

}